import request from '@/utils/request'

export function getCropPage(data) {
  return request({
    url: `/cropParameter/page?cropId=${data.cropId}&keyword=${data.keyword}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function addCropParameter(data) {
  return request({
    url: `/cropParameter/add`,
    method: 'post',
    data: data // body
  })
}

export function updateCropParameter(data) {
  return request({
    url: `/cropParameter/update`,
    method: 'post',
    data: data
  })
}

export function deleteCropParameter(data) {
  return request({
    url: `/cropParameter/delete/${data.cropParameterId}`,
    method: 'post'
  })
}

export function deleteCropList(data) {
  return request({
    url: `/cropParameter/deleteList?ids%5B%5D=${data.item}`,
    method: 'post'
  })
}
